package Railroad.Components;

import java.awt.Color;

// Trieda, ktorá definuje všetky vlastnosti návestidiel.
public class Signal extends TrackItem {
    private final int startX;
    private final int startY;
    private final SignalDirection direction;
    private final boolean main;
    private final String name;
    private Color color;
    private Color BGcolor;
      
    public Signal(int id, int startX, int startY, String direction, int main, String name) {
        super(id);
        this.startX = startX;
        this.startY = startY;
        this.direction = direction.equalsIgnoreCase("right") ? SignalDirection.Right : SignalDirection.Left;
        this.main = (main == 1);
        this.name = name;
      //  color= Color.LIGHT_GRAY;
        color = defaultColor;
        BGcolor = Color.BLACK;
        
    }

    // Gettre.
    public int getStartX() {
        return startX;
    }
    
    public int getStartY() {
        return startY;
    }
    
    public Color getColor(){
        return color;
    }
   
    public void setColor(Color color) {
        this.color = color;
    }

    public void setBGcolor(Color BGcolor) {
        this.BGcolor = BGcolor;
    }
    
    public Color getBKColor() {
        return BGcolor;
    }
    
    public boolean isMain() {
        return main;
    }

    public String getName() {
        return name;
    }
    
    
    public SignalDirection getDirection() {
        return direction;
    }
    
    @Override
    public boolean isOnXY(int x, int y) {
        return x == startX && y == startY;
    }
}

